package com.zzyl.nursing.task;


import com.zzyl.nursing.service.impl.ReservationServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
@Slf4j
public class MyTask {
    @Autowired
    ReservationServiceImpl service;


    @Scheduled(cron = " 0 1,31 * * * *")
    public void executeTask() {
        service.updateReservationStatus();
        log.info("定时任务开始执行：{}", LocalDateTime.now());
    }
}
